package cn.hxth.dubbo.customer.listener;

import cn.hxth.api.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;



import javax.annotation.Resource;
@Component
public class InitAdminListener implements
		ApplicationListener<ContextRefreshedEvent> {

	@Resource
	private IMemberService memberService ;

	/**
	 * 这个方法就是监听到指定的事件之后,要做的事情; ApplicationEvent就是这次监听到的事件对象
	 */
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		memberService.initAdmin();
	}

}
